﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Books.Common
{
    public class GetFileName
    {
        public static string FileName(string bookId, Uri url)
        {
            string temp = string.Empty;
            var toStringUrl = url.LocalPath;
            if (toStringUrl.StartsWith("/resources/"))
                temp = toStringUrl.Replace("/resources/", string.Empty);
            temp = temp.Replace("/", "_");
            temp = string.Concat(bookId, temp);
            return temp;
        }
    }
}
